Shot Noise Analysis

Author

Kantnerova et al. (2023)

Published

November 3, 2023

Setup

Using R version 4.3.1 (2023-06-16) , tidyverse version 2.0.0, and isoorbi version 1.2.9.

# load packages
library(isoorbi) # for orbitrap function
library(dplyr) # for mutating data frames
library(forcats) # for recoding factors
library(ggplot2) # for data visualization
library(cowplot) # arrange multipanel plots

Trifluoroacetate (TFA)

Data

# load, process, and export tfa data
data_tfa <-
  "data/shot_noise/tfa" |>
  orbi_find_isox() |>
  orbi_read_isox() |>
  orbi_simplify_isox() |>
  orbi_flag_satellite_peaks() |>
  orbi_flag_weak_isotopocules(min_percent = 10) |>
  orbi_flag_outliers(agc_fold_cutoff = 2) |>
  orbi_define_basepeak("M0")
#> orbi_read_isox() is loading .isox data from 3 file(s)...
#> - loaded 24406 peaks for 1 compounds (TFA) with 3 isotopocules (M0, 13C, 18O)
#>    from TFA_1E4_AGC.isox in 0.32 seconds.
#> - loaded 4031 peaks for 1 compounds (TFA) with 3 isotopocules (M0, 13C, 18O)
#>    from TFA_M0_1uscan_120kRes.isox in 0.04 seconds.
#> - loaded 24549 peaks for 1 compounds (TFA) with 3 isotopocules (M0, 13C, 18O)
#>    from TFA_M0_1uscan_15kRes.isox in 0.08 seconds.
#> orbi_simplify_isox() will keep only columns 'filename', 'scan.no',
#>    'time.min', 'compound', 'isotopocule', 'ions.incremental', 'tic', 'it.ms',
#>    'intensity'...
#>    ...complete in 0.01 seconds.
#> orbi_flag_satellite_peaks() is flagging minor signals (satellite peaks)...
#>    ...flagged 590/52986 peaks in 3 isotopocules ("M0", "13C", "18O") as
#>    satellite peaks (1.1%) in 1.66 seconds.
#> orbi_flag_weak_isotopocules() is flagging isotopocules from data that are
#>    detected in less than 10% of scans in 3 data group(s) (based on
#>    'filename')...
#>    ...confirmed there are no weak isotopocules in 0.05 seconds.
#> orbi_flag_outliers() is flagging the scans below 1/2 and above 2 times the
#>    average number of ions (`tic` * `it.ms`) in the Orbitrap analyzer in 3
#>    data group(s) (based on 'filename')...
#>    ...confirmed there are no outliers based on this method in 0.17 seconds.
#> orbi_define_basepeak() is setting the 'M0' isotopocule as the ratio
#>    denominator...
#>    ...set base peak and calculated 35256 ratios for 2 isotopocules/base peak
#>    (13C, 18O) in 1.02 seconds.

shot_noise_tfa <- 
  data_tfa |>
  orbi_analyze_shot_noise() |>
  orbi_export_data_to_excel("output/shot_noise_tfa.xlsx")
#> orbi_analyze_shot_noise() is analyzing the shot noise for 34883 peaks
#>    (excluded 373 flagged peaks)...
#>    ...calculations finished in 0.05 seconds.
#> orbi_export_data_to_excel() is exporting data set with 34883 rows and 19
#>    columns to output/shot_noise_tfa.xlsx...
#>    ...completed in 6.58 seconds.

Figure: TFA satellite peaks

data_tfa |> orbi_plot_satellite_peaks()

Figure 1: Satellite peaks

Bonus Figure: TFA isotopocule coverage

data_tfa |> orbi_plot_isotopocule_coverage()

Figure 2: Isotopocule coverage

Bonus Figure: TFA ratios

data_tfa |> orbi_plot_raw_data(y = ratio)

Figure 3: Isotopocule ratios vs. M0

Figure 10: TFA shotnoise vs counts/time

# individual plots
tfa_vs_ions <-
  shot_noise_tfa |>
  orbi_filter_isox(filename = "TFA_M0_1uscan_15kRes") |>
  orbi_plot_shot_noise(x = "n_effective_ions") +
  labs(title = "vs counts") +
  theme(plot.title = element_text(hjust = 0.5))

tfa_vs_time <-
  shot_noise_tfa |>
  orbi_filter_isox(filename = "TFA_M0_1uscan_15kRes") |>
  orbi_plot_shot_noise(permil_target = 1) +
  labs(title = "vs time") +
  theme(plot.title = element_text(hjust = 0.5))

# combine
plot_grid(
  tfa_vs_ions + theme(legend.position = c(0.85, 0.74)), 
  tfa_vs_time + theme(legend.position = "none"),
  align = "h", nrow = 1, axis = "tb"
)

Figure 4: Shot noise vs counts and vs time.

Extended Data Figure 6: TFA shotnoise at different IT

shot_noise_tfa |>
  orbi_filter_isox(filename = c("TFA_1E4_AGC", "TFA_M0_1uscan_15kRes")) |>
  # change color legend
  mutate(
    IT_info = filename |>
      fct_recode(
        "IT = 0.03 ms" = "TFA_1E4_AGC",
        "IT = 0.75 ms" = "TFA_M0_1uscan_15kRes"
      )
  ) |>
  orbi_plot_shot_noise(color = "IT_info") +
  # wrap by the ratio label
  facet_wrap(~ratio_label) +
  theme(legend.position = c(0.41, 0.77))

Figure 5: Shot noise at different ITs.

Extended Data Figure 7: TFA shotnoise at different resolutions

shot_noise_tfa |>
  orbi_filter_isox(filename = c("TFA_M0_1uscan_120kRes", "TFA_M0_1uscan_15kRes")) |>
  # change color legend
  mutate(
    res_info = filename |>
      fct_recode(
        "res. = 120k" = "TFA_M0_1uscan_120kRes",
        "res. = 15k" = "TFA_M0_1uscan_15kRes"
      )
  ) |>
  orbi_plot_shot_noise(color = "res_info") +
  # wrap by the ratio label
  facet_wrap(~ratio_label) +
  theme(legend.position = c(0.42, 0.77))

Figure 6: Shot noise at different resolutions.

Model Peptide (MRFA)

Data

# load, process, and export mrfa data
data_aas <- 
  "data/shot_noise/mrfa" |>
  orbi_find_isox() |>
  orbi_read_isox() |>
  orbi_simplify_isox() |>
  orbi_flag_satellite_peaks() |>
  orbi_flag_weak_isotopocules(min_percent = 10) |> 
  orbi_flag_outliers(agc_fold_cutoff = 2) |> 
  orbi_define_basepeak("M0") |>
  mutate(
    compound = compound |>
      fct_recode(
        "Alanine" = "Ala_imm",
        "Arginine" = "Arg_imm",
        "Methionine" = "Met_imm",
        "Phenylalanine" = "Phe_imm"
      )
  )
#> orbi_read_isox() is loading .isox data from 1 file(s)...
#> - loaded 3853 peaks for 4 compounds (Ala_imm, Arg_imm, Met_imm, Phe_imm) with
#>    6 isotopocules (M0, 15N, 13C, 2H, 33S, 34S) from
#>    MRFA_M1_40NCE_10min_10uscans.isox in 0.04 seconds.
#> orbi_simplify_isox() will keep only columns 'filename', 'scan.no',
#>    'time.min', 'compound', 'isotopocule', 'ions.incremental', 'tic', 'it.ms',
#>    'intensity'...
#>    ...complete in 0.01 seconds.
#> orbi_flag_satellite_peaks() is flagging minor signals (satellite peaks)...
#>    ...flagged 59/3853 peaks in 3 isotopocules ("M0", "15N", "13C") as
#>    satellite peaks (1.5%) in 0.15 seconds.
#> orbi_flag_weak_isotopocules() is flagging isotopocules from data that are
#>    detected in less than 10% of scans in 1 data group(s) (based on
#>    'filename')...
#>    ...confirmed there are no weak isotopocules in 0.06 seconds.
#> orbi_flag_outliers() is flagging the scans below 1/2 and above 2 times the
#>    average number of ions (`tic` * `it.ms`) in the Orbitrap analyzer in 1
#>    data group(s) (based on 'filename')...
#>    ...confirmed there are no outliers based on this method in 0.06 seconds.
#> orbi_define_basepeak() is setting the 'M0' isotopocule as the ratio
#>    denominator...
#>    ...set base peak and calculated 2915 ratios for 5 isotopocules/base peak
#>    (15N, 13C, 2H, 33S, 34S) in 0.07 seconds.

shot_noise_aas <-
  data_aas |>
  orbi_analyze_shot_noise() |> 
  orbi_export_data_to_excel("output/shot_noise_MRFA.xlsx") 
#> orbi_analyze_shot_noise() is analyzing the shot noise for 2874 peaks
#>    (excluded 41 flagged peaks)...
#>    ...calculations finished in 0.03 seconds.
#> orbi_export_data_to_excel() is exporting data set with 2874 rows and 19
#>    columns to output/shot_noise_MRFA.xlsx...
#>    ...completed in 0.48 seconds.

Table

# example of first few rows
shot_noise_aas |>
  arrange(compound, isotopocule, scan.no) |>
  select(compound, scan.no, time.min, isotopocule,
         ratio, ratio_rel_se.permil, shot_noise.permil) |>
  head(10) |>
  knitr::kable()
compound scan.no time.min isotopocule ratio ratio_rel_se.permil shot_noise.permil
Alanine 1 0.059 15N 0.0062453 NaN 73.71127
Alanine 2 0.102 15N 0.0060919 12.43207 52.42764
Alanine 3 0.146 15N 0.0068807 37.74616 42.08467
Alanine 4 0.189 15N 0.0059526 32.61878 36.78579
Alanine 5 0.233 15N 0.0060549 26.57095 32.90351
Alanine 6 0.277 15N 0.0055040 29.99353 30.32862
Alanine 7 0.320 15N 0.0060244 25.50106 28.18264
Alanine 8 0.364 15N 0.0065182 23.43771 26.31067
Alanine 9 0.408 15N 0.0064846 21.36449 24.76418
Alanine 10 0.451 15N 0.0061980 19.10467 23.50447

Bonus Figure: Amino Acids satellite peaks

data_aas |> orbi_plot_satellite_peaks()

Figure 7: Satellite peaks

Bonus Figure: Amino Acids isotopocule coverage

data_aas |> orbi_plot_isotopocule_coverage()

Figure 8: Isotopocule coverage

Bonus Figure: Amino Acids ratios

data_aas |> orbi_plot_raw_data(y = ratio)

Figure 9: Isotopocule ratios vs. M0

Extended Data Figure 8: Amino Acids Shot Noise

shot_noise_aas |>
  filter(compound == "Methionine" | isotopocule != "2H") |>
  orbi_plot_shot_noise()

Figure 10: amino acids shotnoise